Let's look at the spectra extracted from different MIRI optical stimuli.
from IPython.display import HTML
HTML('''<script>
code_show=true;
function code_toggle() {
if (code_show){
$('div.input').hide();
} else {
$('div.input').show();
}
code_show = !code_show
}
$( document ).ready(code_toggle);
</script>
The raw code for this IPython notebook is by default hidden for easier reading.
To toggle on/off the raw code, click <a href="javascript:code_toggle()">here</a>.''')
import funcs
import mrsobs
We load the images for one band of the MRS for different kinds of sources, including:
# Define paths to data
workDir = '/Users/ioannisa/Desktop/python/miri_devel/'
cdpDir = workDir+'cdp_data/'
d2cMapDir = workDir+'distortionMaps/'
lvl2path = workDir+'FM_data/LVL2/'
otisdatapath = workDir+'OTIS_data/'
# Get data
band = '1A'
ext_source_sci,ext_source_bkg = mrsobs.FM_MTS_BB_extended_source(lvl2path,band,bb_temp='800K')
intcal_source_sci = mrsobs.MIRI_internal_calibration_source(lvl2path,band,campaign='FM')
etal_source_sci,etal_source_bkg = mrsobs.FM_MTS_800K_BB_extended_source_through_etalon(lvl2path,band,etalon='ET1A')
point_source_sci,point_source_bkg = mrsobs.FM_MTS_800K_BB_point_source_raster(lvl2path,position='middle',pointing='P1')
semiext_source_sci,semiext_source_bkg = mrsobs.OTIS_ASPA_semiextended_source(otisdatapath,band,pointing='v03')
We subtract background exposures where available (Contamination Control Cover closed for internal calibration source observations, no background exposures taken).
# perform transform
ext_source_bkgsubtr = ext_source_sci-ext_source_bkg
etal_source_bkgsubtr = etal_source_sci-etal_source_bkg
point_source_bkgsubtr = point_source_sci-point_source_bkg
semiext_source_bkgsubtr = semiext_source_sci-semiext_source_bkg
We extract a detector pixel trace based on different criteria, including as example:
d2cMaps = funcs.load_obj('d2cMaps_band'+band,path=d2cMapDir)
nslices = d2cMaps['nslices']
# Pixel trace in MRS slice
#-- extended source
ypos_e,xpos_e = funcs.detpixel_trace(band,d2cMaps,sliceID=nslices/2,alpha_pos=0.)
#-- point source
ypos_p,xpos_p = funcs.detpixel_trace_compactsource(point_source_bkgsubtr,band,d2cMaps)
#-- semi-extended source
ypos_se,xpos_se = funcs.detpixel_trace_compactsource(semiext_source_bkgsubtr,band,d2cMaps)
Let's look at the 2D images and the extracted spectra through the pixel traces.
from matplotlib import pyplot as plt
plt.style.use('presentation')
%matplotlib notebook
# make plots
fig,axs=plt.subplots(1,5,figsize=(25,4))
axs[0].imshow(ext_source_bkgsubtr)
axs[0].set_title('MTS extended source')
axs[1].imshow(intcal_source_sci)
axs[1].set_title('MIRI internal calibration source')
axs[2].imshow(etal_source_bkgsubtr)
axs[2].set_title('MTS etalon spectrum')
axs[3].imshow(point_source_bkgsubtr)
axs[3].set_title('MTS point source')
axs[4].imshow(semiext_source_bkgsubtr)
axs[4].set_title('PAAH semi-extended source')
plt.tight_layout()
fig,axs=plt.subplots(5,1,figsize=(25,20))
axs[0].plot(ext_source_bkgsubtr[ypos_p,xpos_p])
axs[0].set_title('MTS extended source')
axs[1].plot(intcal_source_sci[ypos_p,xpos_p])
axs[1].set_title('MIRI internal calibration source')
axs[2].plot(etal_source_bkgsubtr[ypos_p,xpos_p])
axs[2].set_title('MTS etalon spectrum')
axs[3].plot(point_source_bkgsubtr[ypos_p,xpos_p])
axs[3].set_title('MTS point source')
axs[4].plot(semiext_source_bkgsubtr[ypos_se,xpos_se])
axs[4].set_title('PAAH semi-extended source')
axs[4].set_xlabel('Detector y-coordinate [pix]')
for plot in range(5): axs[plot].set_ylabel('Signal [DN/sec]')
plt.tight_layout()
How does the fringe pattern of extended sources change in different slices / along-slice positions?